import { SelectProps } from 'naive-ui';
import { reactive } from 'vue';

/**这里写一些无需接口定义的options(例如下拉框等) */
const allOptions: Record<string, SelectProps['options']> = {
  status: [
    {label: '正常', value: '0'},
    {label: '停用', value: '1'}
  ]
};
const optionsMap = reactive(new Map());
for (const key in allOptions) {
  optionsMap.set(key, allOptions[key]);
}
/**异步获取选项参数的方法示例 */
async function setstreetName() {
  
}
let isLoading = false

//TODO 若项目要打成npm包，请务必在局部作用域调用
/**若项目要打成npm包，请务必在局部作用域调用 */
export const getOptionsMap = () => {
  if (!isLoading) {
    setstreetName();
    isLoading = true
  }
  return optionsMap;
};

